package zw_701_800.zw_771_宝石与石头;

import java.util.HashSet;

class Solution {

    public static void main(String[] args) {
        String jewels = "aA", stones = "aAAbbbb";
        int num = numJewelsInStones(jewels, stones);
        System.out.println(num);

    }

    public static int numJewelsInStones(String jewels, String stones) {
        HashSet<Character> set = new HashSet<>();
        int ans = 0;
        for (int i = 0; i < jewels.length(); i++) {
            set.add(jewels.charAt(i));
        }
        for (int i = 0; i < stones.length(); i++) {
            if (set.contains(stones.charAt(i))) ans++;
        }
        return ans;
    }
}
